import { useRequest } from 'umi';

import { adminAreadDataGet, loadMdicMap } from '@/services/BaseLayout';
import { getLoadMapList, getTenantID } from '@/utils';

// export interface IUseDeptAddEditParams {

// }

export const useDeptAddEdit = (params: any, curRes: any) => {
  //获取数据字典数据
  const { loadMapInfo, mapLoading } = getLoadMapList([`${getTenantID()}1003`]);

  //  useRequest(() => {
  //   return
  // });

  const areadList = useRequest(() => {
    if (curRes['/commonController/getAreaNum']) {
      return adminAreadDataGet(params);
    } else {
      return [];
    }
  });

  return {
    MapList: loadMapInfo,
    mapLoading,
    areadList,
  };
};
